package hunterxhunter.greedisland.data.enums;

import org.jbox2d.common.Vec2;

/**
 *
 * @author Markus Schr&ouml;der
 */
public enum Direction {

    NO, UP, DOWN, LEFT, RIGHT;
    
    private final String ANIM_MOVE_DOWN = "move/down";
    private final String ANIM_MOVE_UP = "move/up";
    private final String ANIM_MOVE_LEFT = "move/left";
    private final String ANIM_MOVE_RIGHT = "move/right";
    
    public String toAnimation() {
        switch(this) {
            case UP: return ANIM_MOVE_UP;
            case DOWN: return ANIM_MOVE_DOWN;
            case LEFT: return ANIM_MOVE_LEFT;
            case RIGHT: return ANIM_MOVE_RIGHT;
                
            default:
            case NO: return "";
        }
    }
    
    public Vec2 toVec2() {
        switch(this) {
            case UP: return new Vec2(0,-1);
            case DOWN: return new Vec2(0,1);
            case LEFT: return new Vec2(-1,0);
            case RIGHT: return new Vec2(1,0);
                
            default:
            case NO: return new Vec2();
        }
    }
    
}
